//

function userNameFocus() {
    userNameId.className = "import_prompt"
    userNameId.innerHTML = "1 、 由字母、数字、下划线、点、减号组成<br/>2、只能以数字、字母开头或结尾，且长度为4~18"
}
//
function userNameBlur() {
    var userName = document.getElementById("userName")
    var userNameId = document.getElementById("userNameId")
    var ret = /^[0-9a-zA-Z][0-9a-zA-Z_.-]{2,16}[0-9a-zA-Z]$/;
    if (userName.value == "") {
        userNameId.className = "error_prompt"
        userNameId.innerHTML = "通行证用户名不能为空，请输入通行证用户名"
        flagUserName = false
        return
    }

    if ((ret.test(userName.value)) == false) {
        userNameId.className = "error_prompt"
        userNameId.innerHTML = "1 、 由字母、数字、下划线、点、减号组成<br/>2、只能以数字、字母开头或结尾，且长度为4~18"
        flagUserName = false
        return
    }

    userNameId.className = "ok_prompt"
    userNameId.innerHTML = "通行证用户名输入正确"
    flagUserName = true
    return
}
//
function pwdFocus() {
    var pwdId = document.getElementById("pwdId");
    pwdId.className = "import_prompt";
    pwdId.innerHTML = "密码6~16"
}

function pwdBlur() {
    var pwd = document.getElementById("pwd");
    var pwdId = document.getElementById("pwdId")
    if (pwd.vale == "") {
        pwdId.className = "error_prompt"
        pwdId.innerHTML = "密码不能为空"
        flagPWd = false
        return
    }
    if (pwd.value.length < 6 || pwd.value.length > 16) {
        pwdId.className = "error_prompt"
        pwdId.innerHTML = "密码6~16"
        flagPWd = false
        return
    }
    pwdId.className = "ok_prompt"
    pwdId.innerHTML = "密码输入正确"
    flagPWd = ture
    return
}
function checkForm() {
    var pwdId = document.getElementById("pwdId");

    if (flagUserName == ture && flagPWd == ture) {
        pwdId.innerHTML = "注册成功"
        document.myform.submit();
    } else {
        alert("输入有误，无法注册")
    }
}